package com.yangfan.thread.thread_wangwenjun13;


import java.util.function.Consumer;

/**
 * 生产者消费者设计模式
 */

public class ProducerAndConsumerClient {

    public static void main(String[] args) {

        final MessageQueue messageQueue = new MessageQueue();
        new ProducerThread(messageQueue, 1).start();
        new ProducerThread(messageQueue, 2).start();
        new ProducerThread(messageQueue, 3).start();
        new ConsumerThread(messageQueue, 1).start();
        new ConsumerThread(messageQueue, 2).start();

    }
}
